package com.lingshi.shopping_goods_service.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lingshi.common.entity.Goods;
import com.lingshi.common.entity.GoodsDesc;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GoodsMapper extends BaseMapper<Goods> {
    void addSpecificationOption(@Param("gid") Long gid,@Param("optionId") Long optionId);

    @Delete("delete from t_goods_specification_option where gid = #{gid}")
    void deleteSpecificationOptionByGoodsId(Long id);

    Goods findById(Long id);

    /**
     * 查询所有的数据封装成ES需要数据对象
     * @return
     */
    List<GoodsDesc> findAll();

    GoodsDesc findGoodDescById(Long id);
}
